﻿using KenafearcuweYemjecahee;
using MaterialDesignThemes.Wpf;
using Modules.MSentEvent;
using Prism.Events;
using Prism.Ioc;
using System.Windows;

namespace Sorting.App.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        IEventAggregator ea;
        IContainerExtension _container;

        public MainWindow(IEventAggregator eventAggregator,
            IContainerExtension container
            )
        {
            InitializeComponent();
            _container=container;


            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //FullScreenHelper.StartFullScreen(this);

            #region 接受加载完成消息
            ea = eventAggregator;
            ea.GetEvent<LoadingSentEvent>().Subscribe(MessageReceived);
            #endregion

        }


        private  void MessageReceived(int loginState)
        {
            if (loginState==1)
            {

                FullScreenHelper.StartFullScreen(this);

            }
        }

        /// <summary>
        /// 关闭对话筐响应
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void ClosingEventHandler(object sender, DialogClosingEventArgs eventArgs)
        {


        }

        /// <summary>
        /// 打开对话框相应
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void OpenEventHandler(object sender, DialogOpenedEventArgs eventArgs)
        {

        }
    }
}
